﻿/*
 *       This file is part of VFC.
 *
 *        VFC is free software: you can redistribute it and/or modify
 *        it under the terms of the GNU General Public License as published by
 *        the Free Software Foundation, either version 3 of the License, or
 *        (at your option) any later version.
 *
 *        VFC is distributed in the hope that it will be useful,
 *        but WITHOUT ANY WARRANTY; without even the implied warranty of
 *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *        GNU General Public License for more details.
 *
 *        You should have received a copy of the GNU General Public License
 *        along with VFC.  If not, see <http://www.gnu.org/licenses/>.
 */


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VFC
{
    public partial class frmMemViewer : Form
    {
        public frmMemViewer()
        {
            InitializeComponent();
        }

        private void cmdShow_Click(object sender, EventArgs e)
        {
            switch (ComboMem.Text)
            {
                case "ZERO PAGE ($0000 - $00ff)":
                    MemView.Text = Nes.Cpu.Memory.GetMemoryContent(0x0000, 0x00ff);
                    break;
                case "PRG ROM 1 ($8000 - $bfff)":
                    MemView.Text = Nes.Cpu.Memory.GetMemoryContent(0x8000, 0xbfff);
                    break;
                case "PRG ROM 2 ($c000 - $ffff)":
                    MemView.Text = Nes.Cpu.Memory.GetMemoryContent(0xc000, 0xffff);
                    break;
                case "STACK ($0100 – $01FF)":
                    MemView.Text = Nes.Cpu.Memory.GetMemoryContent(0x0100, 0x01ff);
                    break;
                case "RAM ($0200 – $07FF)":
                    MemView.Text = Nes.Cpu.Memory.GetMemoryContent(0x0200, 0x07ff);
                    break;
                case "SRAM ($6000 – $7FFF)":
                    MemView.Text = Nes.Cpu.Memory.GetMemoryContent(0x6000, 0x7fff);
                    break;
            }
        }
    }
}
